package  
{
	import flash.utils.ByteArray;
	import net.flashpunk.Entity;
	import net.flashpunk.graphics.Tilemap;
	import net.flashpunk.masks.Grid;
	/**
	 * © 2012 TheJavaArcade.com
	 */	
	public class Vines extends Entity {
		public var vines:Tilemap;
		private var grid:Grid;
		
		public function Vines(theLevel:int) {
			vines = new Tilemap(Assets.VINE_TILES, 1200, 720, 8, 8);
			grid = new Grid(1200, 720, 8, 8);
			layer = 1;
			graphic = vines;
			mask = grid;
			type = "vines"
			loadLevel(theLevel);
		}
		
		private function loadLevel(theLevel:int):void {
			var dataList:XMLList;
			var dataElement:XML;
			
			dataList = GameEngine.levelXML[theLevel].vines.tile;
			for each(dataElement in dataList) {
				vines.setTile(dataElement.@x, dataElement.@y, dataElement.@id);
				grid.setTile(dataElement.@x, dataElement.@y, true);
			}
		}
	}

}